package com.devshephard.rpcframework.rpc.util;

import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.ApplicationContext;

import java.util.Set;

public class TcpResourceHolder {

    public static Set<String> basePackages;

    public static Set<BeanDefinition> candidateComponents;

    public static ApplicationContext applicationContext;

    public static Set<String> getBasePackages() {
        return basePackages;
    }

    public static void setBasePackages(Set<String> basePackages) {
        TcpResourceHolder.basePackages = basePackages;
        TcpResourceHolder.candidateComponents = candidateComponents;
    }

    public TcpResourceHolder(Set<String> basePackages, Set<BeanDefinition> candidateComponents, ApplicationContext applicationContext) {
        this.basePackages = basePackages;
        this.candidateComponents = candidateComponents;
        this.applicationContext = applicationContext;
    }

    public static Set<BeanDefinition> getCandidateComponents() {
        return candidateComponents;
    }

    public static void setCandidateComponents(Set<BeanDefinition> candidateComponents) {
        TcpResourceHolder.candidateComponents = candidateComponents;
    }

    public static ApplicationContext getApplicationContext() {
        return applicationContext;
    }

    public static void setApplicationContext(ApplicationContext applicationContext) {
        TcpResourceHolder.applicationContext = applicationContext;
    }
}
